package com.dnjn.happiness.oss.api;

import com.dnjn.happiness.common.core.constant.SecurityConstants;
import com.dnjn.happiness.common.core.constant.ServiceNameConstants;
import com.dnjn.happiness.common.core.web.domain.AjaxResult;
import com.dnjn.happiness.oss.api.factory.RemoteMinioFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(contextId = "remoteMinioService",value = ServiceNameConstants.OSS_SERVICE,fallbackFactory = RemoteMinioFallbackFactory.class)
@Deprecated
public interface RemoteMinioService {

    @PostMapping(value = "/minio/uploadMinioCommonInnerApi",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public AjaxResult uploadMinioCommonInnerApi(@RequestPart("file") MultipartFile file,@RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;

    @PostMapping(value = "/minio/uploadAvatarMinio",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public AjaxResult uploadAvatarMinio(@RequestPart("file") MultipartFile file, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;
}
